package homeWork.title7;

import java.util.Arrays;

/*有一个这样的数组int[] arr = {1,2,3,3,2,1}，
   请编写程序去除该数组中重复的元素
   */
public class main {
    public static void main(String[] args) {
        int arr [] = {1,2,3,3,2,1};
        int aaa [] = new int[arr.length];
        int a = 0;
       othe: for (int i = 0; i < arr.length; i++) {
            for (int i1 = i+1; i1 < arr.length; i1++) {
                if (arr[i]==arr[i1]){
                    continue othe;
                }
            }
            aaa[a] = arr[i];
            a++;
        }
        int bbb[] = new int [a];
        for (int i = 0; i < bbb.length; i++) {
            bbb[i]=aaa[i];
        }
        System.out.println(Arrays.toString(bbb));
    }
}

